package entity;


import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Locale;

public class Patient implements java.io.Serializable {

  private long pId;
  private String pName;
  private String pCards;
  private String pSex;
  private String pEmal;
  @DateTimeFormat(pattern = "yyyy-MM-dd")
  private String pBirthDate;
  private String pPhone;
  private int rStat;

  public int getrStat() {
    return rStat;
  }

  public void setrStat(int rStat) {
    this.rStat = rStat;
  }

  public String getpBirthDate() {
    return pBirthDate;
  }

  public void setpBirthDate(String pBirthDate) {
      if (pBirthDate.indexOf("中")!=-1){
        SimpleDateFormat format=new SimpleDateFormat("EEE MMM dd yyyy hh:mm:ss z",Locale.ENGLISH);
        try {
          this.pBirthDate = (format.parse(pBirthDate)).toString();
        } catch (ParseException e) {
          e.printStackTrace();
        }
      }else {
        this.pBirthDate=pBirthDate;
      }

  }


  public long getpId() {
    return pId;
  }

  public void setpId(long pId) {
    this.pId = pId;
  }

  public String getpName() {
    return pName;
  }

  public void setpName(String pName) {
    this.pName = pName;
  }

  public String getpCards() {
    return pCards;
  }

  public void setpCards(String pCards) {
    this.pCards = pCards;
  }

  public String getpSex() {
    return pSex;
  }

  public void setpSex(String pSex) {
    this.pSex = pSex;
  }

  public String getpEmal() {
    return pEmal;
  }

  public void setpEmal(String pEmal) {
    this.pEmal = pEmal;
  }

  public String getpPhone() {
    return pPhone;
  }

  public void setpPhone(String pPhone) {
    this.pPhone = pPhone;
  }
}
